package com.qiwx.pigeon.adapter.produce;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.qiwx.pigeon.R;
import com.qiwx.pigeon.Utils.DateTimeUtils;
import com.qiwx.pigeon.adapter.home.ICageInterface;
import com.qiwx.pigeon.data.CageStatusConfig;
import com.qiwx.pigeon.data.db.CageRecordModel;
import com.qiwx.pigeon.data.db.CageStatusRecord;
import com.qiwx.pigeon.data.vo.CageBean;
import com.qiwx.pigeon.data.vo.CageStatusRecordBean;

import java.util.List;

/**
 * @description
 * @Author qiwx
 * @Date 2020-04-08 11:35
 * 鸽笼状态适配器
 **/
public class CageStatusRecordAdapter extends BaseQuickAdapter<CageStatusRecordBean, BaseViewHolder> {
    ICageInterface iCageInterface;

    public CageStatusRecordAdapter(int layoutResId, List<CageStatusRecordBean> data) {
        super(layoutResId, data);
    }

    public void setiCageInterface(ICageInterface iCageInterface) {
        this.iCageInterface = iCageInterface;
    }

    @Override
    protected void convert(BaseViewHolder holder, CageStatusRecordBean cageBean) {

        int status = cageBean.getProduce_status();
        holder.setText(R.id.txt_status, CageStatusConfig.getProduceStatusDes(status));
        long timeStamp=DateTimeUtils.date2TimeStamp(cageBean.getOperate_time(),"yyyy-MM-dd HH:mm:ss");
        holder.setText(R.id.txt_time, DateTimeUtils.timeStamp2MDHMSS(timeStamp) );
        int operateId = cageBean.getOperate_user_id();
        holder.setText(R.id.txt_operate, operateId == 0 ? "系统" : "人工");
    }
}
